<template>
  <div>
    <!-- 太化 -->
    <el-form label-position="left" label-width="100px" :model="formLabelAlign" :rules="rules" ref="ruleForm">
        <el-form-item label="培训科目" required  prop="subject_id">
            <el-cascader 
                style="width:100%"
                v-model="formLabelAlign.subject_id"
                @change="subChange"
                class="filter-item" 
                placeholder="请选择培训科目" 
                clearable 
                :options="subjectListTree" 
                :props="{label:'title',value:'id',key:'id'}"
            ></el-cascader>
        </el-form-item>
        <el-form-item label="姓名" required prop="nickname">
            <el-input v-model="formLabelAlign.nickname">
            </el-input>
        </el-form-item>
        <el-form-item label="性别" required prop="gender">
            <el-select v-model="formLabelAlign.gender" placeholder="请选择" style="width:100%">
                <el-option
                label="男"
                value="男">
                </el-option>
                <el-option
                label="女"
                value="女">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="民族" required prop="nation">
            <el-input v-model="formLabelAlign.nation">
            </el-input>
        </el-form-item>
        <el-form-item label="政治面貌" required  prop="政治面貌">
            <el-select v-model="formLabelAlign.政治面貌" placeholder="请选择" style="width:100%">
                <el-option
                label="党员"
                value="党员">
                </el-option>
                <el-option
                label="团员"
                value="团员">
                </el-option>
                <el-option
                label="群众"
                value="群众">
                </el-option>
                <el-option
                label="民主党派"
                value="民主党派">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="文化程度" required prop="education">
            <el-select v-model="formLabelAlign.education" placeholder="请选择" style="width:100%">
                <el-option
                v-if="subjectlist[0]==559"
                label="高中"
                value="高中">
                </el-option>
                <el-option
                v-if="subjectlist[0]==559"
                label="中专"
                value="中专">
                </el-option>
                <el-option
                v-if="subjectlist[0]==559"
                label="职高"
                value="职高">
                </el-option>
                <el-option
                v-if="subjectlist[0]==559"
                label="技校"
                value="技校">
                </el-option>
                <el-option
                v-if="subjectlist[0]==559||subjectlist[0]==560"
                label="大专"
                value="大专">
                </el-option>
                <el-option
                v-if="subjectlist[0]==559||subjectlist[0]==560"
                label="本科"
                value="本科">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="证件类型" required prop="证件类型">
            <el-select v-model="formLabelAlign.证件类型" placeholder="请选择" style="width:100%">
                <el-option
                label="身份证"
                value="身份证">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="身份证号" required prop="username">
            <el-input v-model="formLabelAlign.username">
            </el-input>
        </el-form-item>
        <el-form-item label="职业类别" prop="category">
            <el-input v-model="formLabelAlign.category">
            </el-input>
        </el-form-item>
        <el-form-item label="外语语种" required prop="外语语种">
            <el-input v-model="formLabelAlign.外语语种">
            </el-input>
        </el-form-item>
        <el-form-item label="毕业学校" required prop="毕业学校">
            <el-input v-model="formLabelAlign.毕业学校">
            </el-input>
        </el-form-item>
        <el-form-item label="毕业日期" required prop="毕业日期">
            <el-date-picker
                style="width:100%"
                v-model="formLabelAlign.毕业日期"
                type="date"
                format='yyyy年MM月dd日'
                value-format='yyyy年MM月dd日'
                placeholder="选择日期">
            </el-date-picker>
        </el-form-item>
        <el-form-item label="毕业证书编号" :required='subjectlist[0]!=559' prop="毕业证书编号">
            <el-input v-model="formLabelAlign.毕业证书编号" placeholder="国民教育系列的高等教育毕业证书编号">
            </el-input>
        </el-form-item>
        <el-form-item label="工作单位所在地" prop='region_id'>
            <div style="width:100%;display:flex;justify-content: space-between;">
                <el-select v-model='省' placeholder="请选择" style="width:30%" @change="regio('省',$event)">
                    <el-option
                    v-for="item in sList"
                    :key="item.region_id"
                    :label="item.region_name"
                    :value="item.region_id">
                    </el-option>
                </el-select>
                <el-select v-model="市" placeholder="请选择" style="width:30%" @change="regio('市',$event)">
                    <el-option
                    v-for="item in hList"
                    :key="item.region_id"
                    :label="item.region_name"
                    :value="item.region_id">
                    </el-option>
                </el-select>
                <el-select v-model="县" placeholder="请选择" style="width:30%" @change="regio('县',$event)">
                    <el-option
                    v-for="item in xList"
                    :key="item.region_id"
                    :label="item.region_name"
                    :value="item.region_id">
                    </el-option>
                </el-select>
            </div>
        </el-form-item>
        <el-form-item label="参加工作日期" prop='参加工作日期'>
            <el-date-picker
                v-model="formLabelAlign.参加工作日期"
                style="width:100%"
                type="date"
                format='yyyy年MM月dd日'
                value-format='yyyy年MM月dd日'
                placeholder="选择日期">
            </el-date-picker>
        </el-form-item>
        <el-form-item label="邮寄地址" prop='邮寄地址'>
            <el-input v-model="formLabelAlign.邮寄地址" placeholder='录取通知书邮寄地址'>
            </el-input>
        </el-form-item>
        <el-form-item label="邮政编码" prop='postcode'>
            <el-input v-model="formLabelAlign.postcode" type='number'>
            </el-input>
        </el-form-item>
        <el-form-item label="联系电话" required prop='phone'>
            <el-input v-model="formLabelAlign.phone" type='number'>
            </el-input>
        </el-form-item>
        <el-form-item label="户口所在地" required prop='户口所在地'>
            <div style="width:100%;display:flex;justify-content: space-between;">
                <el-select v-model='J省' placeholder="请选择" style="width:30%" @change="regioA('省',$event)">
                    <el-option
                    v-for="item in JsList"
                    :key="item.region_id"
                    :label="item.region_name"
                    :value="item.region_id">
                    </el-option>
                </el-select>
                <el-select v-model="J市" placeholder="请选择" style="width:30%" @change="regioA('市',$event)">
                    <el-option
                    v-for="item in JhList"
                    :key="item.region_id"
                    :label="item.region_name"
                    :value="item.region_id">
                    </el-option>
                </el-select>
                <el-select v-model="J县" placeholder="请选择" style="width:30%" @change="regioA('县',$event)">
                    <el-option
                    v-for="item in JxList"
                    :key="item.region_id"
                    :label="item.region_name"
                    :value="item.region_id">
                    </el-option>
                </el-select>
            </div>
        </el-form-item>
        <el-form-item label="报考层次" required prop='报考层次'>
            <el-select v-model="formLabelAlign.报考层次" placeholder="请选择" style="width:100%">
                <el-option
                 v-if="subjectlist[0]!=559"
                label="专升本"
                value="专升本">
                </el-option>
                <el-option
                v-else
                label="高起专"
                value="高起专">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="报考科类" required prop='报考科类'>
            <el-select v-model="formLabelAlign.报考科类" placeholder="请选择" style="width:100%" @change="klchange">
                <el-option
                label="理工类"
                value="理工类">
                </el-option>
                <el-option
                v-if="subjectlist[0]==559"
                label="文史类"
                value="文史类">
                </el-option>
                <el-option
                v-else
                label="经管类"
                value="经管类">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="志愿一学校" required prop='志愿一学校'>
            <el-select v-model="formLabelAlign.志愿一学校" placeholder="请选择" style="width:100%">
                <el-option
                v-if="formLabelAlign.报考科类!='文史类'&&formLabelAlign.报考科类!=''"
                label="北京化工大学"
                value="北京化工大学">
                </el-option>
                <el-option
                v-if="subjectlist[0]==559&&formLabelAlign.报考科类!=''"
                label="太化职工大学"
                value="太化职工大学">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="志愿一专业" required prop='志愿一专业'>
            <el-select v-model="formLabelAlign.志愿一专业" placeholder="请选择" style="width:100%" v-if="subjectlist[0]!=559">
                <el-option
                    v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.报考科类!=''"
                    label="化学工程与工艺"
                    value="化学工程与工艺">
                    </el-option>
                    <el-option
                    v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.报考科类!=''"
                    label="自动化"
                    value="自动化">
                    </el-option>
                    <el-option
                    v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.报考科类!=''"
                    label="过程装备与控制工程"
                    value="过程装备与控制工程">
                    </el-option>
                    <el-option
                    v-if="formLabelAlign.报考科类!='理工类'&&formLabelAlign.报考科类!=''"
                    label="会计学"
                    value="会计学">
                    </el-option>
                    <el-option
                    v-if="formLabelAlign.报考科类!='理工类'&&formLabelAlign.报考科类!=''"
                    label="工商管理"
                    value="工商管理">
                    </el-option>
            </el-select>
            <el-select v-model="formLabelAlign.志愿一专业" placeholder="请选择" style="width:100%" v-else>
                <el-option
                v-if="formLabelAlign.报考科类=='文史类'"
                label="行政管理"
                value="行政管理">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='文史类'"
                label="工程造价"
                value="工程造价">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'"
                label="应用化工技术"
                value="应用化工技术">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿一学校=='太化职工大学'"
                label="行政管理"
                value="行政管理">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿一学校=='太化职工大学'"
                label="工程造价"
                value="工程造价">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿一学校=='太化职工大学'"
                label="机电一体化技术"
                value="机电一体化技术">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿一学校=='太化职工大学'"
                label="煤炭清洁利用技术"
                value="煤炭清洁利用技术">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿一学校=='太化职工大学'"
                label="化工装备技术"
                value="化工装备技术">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="志愿二学校" prop='志愿二学校'>
            <el-select v-model="formLabelAlign.志愿二学校" placeholder="请选择" style="width:100%">
                <el-option
                v-if="formLabelAlign.报考科类!='文史类'"
                label="北京化工大学"
                value="北京化工大学">
                </el-option>
                <el-option
                v-if="subjectlist[0]==559"
                label="太化职工大学"
                value="太化职工大学">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="志愿二专业" prop='志愿二专业'>
            <el-select v-model="formLabelAlign.志愿二专业" placeholder="请选择" style="width:100%" v-if="subjectlist[0]!=559">
                <el-option
                    v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.报考科类!=''"
                    label="化学工程与工艺"
                    value="化学工程与工艺">
                    </el-option>
                    <el-option
                    v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.报考科类!=''"
                    label="自动化"
                    value="自动化">
                    </el-option>
                    <el-option
                    v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.报考科类!=''"
                    label="过程装备与控制工程"
                    value="过程装备与控制工程">
                    </el-option>
                    <el-option
                    v-if="formLabelAlign.报考科类!='理工类'&&formLabelAlign.报考科类!=''"
                    label="会计学"
                    value="会计学">
                    </el-option>
                    <el-option
                    v-if="formLabelAlign.报考科类!='理工类'&&formLabelAlign.报考科类!=''"
                    label="工商管理"
                    value="工商管理">
                    </el-option>
            </el-select>
            <el-select v-model="formLabelAlign.志愿二专业" placeholder="请选择" style="width:100%" v-else>
                <el-option
                v-if="formLabelAlign.报考科类=='文史类'"
                label="行政管理"
                value="行政管理">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='文史类'"
                label="工程造价"
                value="工程造价">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'"
                label="应用化工技术"
                value="应用化工技术">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿二学校=='太化职工大学'"
                label="行政管理"
                value="行政管理">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿二学校=='太化职工大学'"
                label="工程造价"
                value="工程造价">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿二学校=='太化职工大学'"
                label="机电一体化技术"
                value="机电一体化技术">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿二学校=='太化职工大学'"
                label="煤炭清洁利用技术"
                value="煤炭清洁利用技术">
                </el-option>
                <el-option
                v-if="formLabelAlign.报考科类=='理工类'&&formLabelAlign.志愿二学校=='太化职工大学'"
                label="化工装备技术"
                value="化工装备技术">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="免冠照片上传" prop='photo'>
            <upload 
                action='/admin/MemberApply/upload'
                accept='image/*'
                :data='{field:"photo"}'
                :fileList="fileList"
                :plain='false'
                @change="upChange" 
                @remove='remove(this.fileList)'
                :showPictureCard='false'
                />
        </el-form-item>
        <el-form-item label="身份证正面" :required='subjectlist[0]==559' prop='id_card_photo'>
            <upload 
                action='/admin/MemberApply/upload'
                accept='image/*'
                :data='{field:"id_card_photo"}'
                :fileList="fileListA"
                :plain='false'
                @change="upChange" 
                @remove='remove(this.fileListA)'
                :showPictureCard='false'
                />
        </el-form-item>
        <el-form-item label="身份证反面" :required='subjectlist[0]==559' prop='id_card_emblem'>
            <upload 
                action='/admin/MemberApply/upload'
                accept='image/*'
                :data='{field:"id_card_emblem"}'
                :fileList="fileListB"
                :plain='false'
                @change="upChange" 
                @remove='remove(this.fileListB)'
                :showPictureCard='false'
                />
        </el-form-item>
        <el-form-item label="毕业证照片" :required='subjectlist[0]==559' prop='edu_photo'>
            <upload 
                action='/admin/MemberApply/upload'
                accept='image/*'
                :data='{field:"edu_photo"}'
                :fileList="fileListC"
                :plain='false'
                @change="upChange" 
                @remove='remove(this.fileListC)'
                :showPictureCard='false'
                />
        </el-form-item>
    </el-form>
    <!-- <el-button @click="commit">点击</el-button> -->
  </div>
</template>

<script>
import{subjectList,regionList}from'@/api/apply.js'
export default {
    props:['gz'],
    data() {
        return {
            formLabelAlign:{
                subject_id:'',
                nickname:'',
                gender:'',
                nation:'汉',
                education:'',
                username:'',
                category:'',
                region_id:'',
                postcode:0,
                phone:0,
                photo:'',
                id_card_photo:'',
                id_card_emblem:'',
                edu_photo:'',
                政治面貌:'',
                证件类型:'身份证',
                外语语种:'英语',
                毕业学校:'',
                毕业日期:'',
                毕业证书编号:'',
                参加工作日期:'',
                邮寄地址:'',
                户口所在地:'',
                报考层次:'',
                报考科类:'',
                志愿一学校:'',
                志愿一专业:'',
                志愿二学校:'',
                志愿二专业:'',
                
            },
            subjectlist:[],
            subjectListTree:[],
            省:'',
            市:'',
            县:'',
            省T:'',
            市T:'',
            县T:'',
            sList:[],
            hList:[],
            xList:[],
            J省:'',
            J市:'',
            J县:'',
            J省T:'',
            J市T:'',
            J县T:'',
            JsList:[],
            JhList:[],
            JxList:[],
            fileList:[],
            fileListA:[],
            fileListB:[],
            fileListC:[],
            rules:{
                subject_id:[
                    { required: true, message: '请输入培训科目', trigger: 'change' },
                ],
                nickname:[
                    { required: true, message: '请输入姓名', trigger: 'blur' },
                ],
                gender:[{ required: true, message: '请输入性别', trigger: 'change' },],
                nation:[{ required: true, message: '请输入民族', trigger: 'blur' },],
                政治面貌:[{ required: true, message: '请输入政治面貌', trigger: 'change' },],
                education:[{ required: true, message: '请输入文化程度', trigger: 'change' },],
                证件类型:[{ required: true, message: '请输入证件类型', trigger: 'blur' },],
                username:[{ required: true, message: '请输入身份证号', trigger: 'blur' },
                    { validator: (rule, value, callback)=>{
                    let IDCard = /^[1-9]\d{5}(17|18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9X]$/; //身份证号校验
                    if(!IDCard.test(value)){
                        return callback(new Error('身份证不合法'));
                    }
                    callback();
                    }, trigger: 'blur' }
                
                ],
                毕业学校:[{ required: true, message: '请输入毕业学校', trigger: 'blur' },],
                外语语种:[{ required: true, message: '请输入外语语种', trigger: 'blur' },],
                毕业日期:[{ required: true, message: '请输入毕业日期', trigger: 'blur' },],
                毕业证书编号:[{ required: true, message: '请输入毕业证书编号', trigger: 'blur' },],
                phone:[{ required: true, message: '请输入联系电话', trigger: 'blur' },
                { validator:(rule, value, callback)=>{
                        let phone = /^1[3456789]\d{9}$/; //手机号校验
                        if(!phone.test(value)){
                            return callback(new Error('请输入有效手机号'));
                        }
                        callback();
                     } , trigger: 'blur' }
                ],
                户口所在地:[{ required: true, message: '请输入户口所在地', trigger: 'change' },],
                报考层次:[{ required: true, message: '请输入报考层次', trigger: 'change' },],
                报考科类:[{ required: true, message: '请输入报考科类', trigger: 'change' },],
                志愿一学校:[{ required: true, message: '请输入志愿一学校', trigger: 'change' },],
                志愿一专业:[{ required: true, message: '请输入志愿一专业', trigger: 'change' },],
                志愿二学校:[{ required: true, message: '请输入志愿二学校', trigger: 'change' },],
                志愿二专业:[{ required: true, message: '请输入志愿二专业', trigger: 'change' },],
                // id_card_photo:[{ required: true, message: '请上传身份证正面', trigger: 'change' },],
                // id_card_emblem:[{ required: true, message: '请上传身份证反面', trigger: 'change' },],
                // edu_photo:[{ required: true, message: '请上传毕业证照片', trigger: 'change' },],
            },
        }
    },
    watch:{
        // gz(val){
        //     console.log(val);
        //     this.subject()
        // }
    },
    methods: {
        subChange(val){
            this.subjectlist=val
            this.formLabelAlign={
                subject_id:val[val.length-1],
                nickname:'',
                gender:'',
                nation:'汉',
                政治面貌:'',
                education:'',
                证件类型:'身份证',
                username:'',
                category:'',
                外语语种:'英语',
                毕业学校:'',
                毕业日期:'',
                毕业证书编号:'',
                region_id:'',
                参加工作日期:'',
                邮寄地址:'',
                postcode:0,
                phone:0,
                户口所在地:'',
                报考层次:'',
                报考科类:'',
                志愿一学校:'',
                志愿一专业:'',
                志愿二学校:'',
                志愿二专业:'',
                photo:'',
                id_card_photo:'',
                id_card_emblem:'',
                edu_photo:'',
            }
            this.fileList=[]
            this.fileListA=[]
            this.fileListB=[]
            this.fileListC=[]
            if(this.formLabelAlign.subject_id==559){
                this.rules.id_card_photo=[{ required: true, message: '请上传身份证正面', trigger: 'change' },]
                this.rules.id_card_emblem=[{ required: true, message: '请上传身份证反面', trigger: 'change' },]
                this.rules.edu_photo=[{ required: true, message: '请上传毕业证照片', trigger: 'change' },]
                this.rules.毕业证书编号=[]
            }else{
                this.rules.id_card_photo=[]
                this.rules.id_card_emblem=[]
                this.rules.edu_photo=[]
                 this.rules.毕业证书编号=[{ required: true, message: '请输入毕业证书编号', trigger: 'blur' },]
            }
        },
        klchange(){
            this.formLabelAlign.志愿一学校=''
            this.formLabelAlign.志愿一专业=''
            this.formLabelAlign.志愿二学校=''
            this.formLabelAlign.志愿二专业=''
        },
        upChange(file){
            if(file.status=='success'&&file.response.code==200){
                this.formLabelAlign[file.response.data.field] = file.response.data.url
                this.$message.success(file.response.msg)
            }else if(file.status=='success'&&file.response.code!=200){
                this.$message.error(file.response.msg)
            }
        },
        remove(list){
            list=[]
        },
        commit(){
            let objA = {
                subject_id:this.formLabelAlign.subject_id,
                subject_ids:this.formLabelAlign.subject_id,
                nickname:this.formLabelAlign.nickname,
                gender:this.formLabelAlign.gender,
                nation:this.formLabelAlign.nation,
                education:this.formLabelAlign.education,
                username:this.formLabelAlign.username,
                category:this.formLabelAlign.category,
                region_id:this.formLabelAlign.region_id,
                postcode:this.formLabelAlign.postcode,
                phone:this.formLabelAlign.phone,
                photo:this.formLabelAlign.photo,
                id_card_photo:this.formLabelAlign.id_card_photo,
                id_card_emblem:this.formLabelAlign.id_card_emblem,
                edu_photo:this.formLabelAlign.edu_photo,
                gz:this.gz
            }
            let objB={
                政治面貌:this.formLabelAlign.政治面貌,
                证件类型:this.formLabelAlign.证件类型,
                外语语种:this.formLabelAlign.外语语种,
                毕业学校:this.formLabelAlign.毕业学校,
                毕业日期:this.formLabelAlign.毕业日期,
                毕业证书编号:this.formLabelAlign.毕业证书编号,
                参加工作日期:this.formLabelAlign.参加工作日期,
                邮寄地址:this.formLabelAlign.邮寄地址,
                户口所在地:this.formLabelAlign.户口所在地,
                报考层次:this.formLabelAlign.报考层次,
                报考科类:this.formLabelAlign.报考科类,
                志愿一学校:this.formLabelAlign.志愿一学校,
                志愿一专业:this.formLabelAlign.志愿一专业,
                志愿二学校:this.formLabelAlign.志愿二学校,
                志愿二专业:this.formLabelAlign.志愿二专业,
            }
            let arr = false
             this.$refs.ruleForm.validate((valid) => {
                if (valid) {
                    // this.$emit('formlist',)
                    arr = [objA,objB]
                } else {
                    this.$message.error('请完成所有必填项目后提交')
                    return false;
                }
            });
            return arr
        },
        subject(){
            subjectList(this.gz).then(res=>{
                this.subjectListTree=res
            })
        },
        deep(list=[],id){
            let title = ''
            for(let i=0;i<list.length;i++){
                let item = list[i]
                if(item.region_id==id){
                    title=item.region_name
                }
            }
            return title
        },
        regio(title,id){
            regionList({region_pid:id?id:0}).then(res=>{
                if(!id){
                    this.sList=res.data.list
                }
                if(title=='省'){
                    // this.省=item.region_name
                    this.市=''
                    this.县=''
                    this.hList=res.data.list
                }
                if(title=='市'){
                    this.县=''
                    this.xList=res.data.list
                }
                if(title=='县'){
                    let arr = []
                    arr.push(this.省,this.市,this.县)
                    this.formLabelAlign.region_id = arr.join(',')
                }
            })
        },
        regioA(title,id){
            regionList({region_pid:id?id:0}).then(res=>{
                if(!id){
                    this.JsList=res.data.list
                }
                if(title=='省'){
                    // this.省=item.region_name
                    this.J市=''
                    this.J县=''
                    this.JhList=res.data.list
                }
                if(title=='市'){
                    this.J县=''
                    this.JxList=res.data.list
                    let arr = []
                    arr.push(this.J省,this.J市)
                    this.formLabelAlign.户口所在地 = arr.join(',')
                }
                if(title=='县'){
                    let arr = []
                    arr.push(this.J省,this.J市,this.J县)
                    this.formLabelAlign.户口所在地 = arr.join(',')
                }
            })
        },
    },
    created() {
        this.subject()
        this.regio()
        this.regioA()
       
    },
}
</script>

<style>

</style>